import Attribute;
import Enum;
import Operation;

import java.util.Vector;


public class Cls {

		public String id,type,name,me;
		public Vector<Attribute> att;
		public Vector<Operation> oper;
		public Vector<Enum> en;
		
		public Cls(){
			att =new Vector<Attribute>();
			oper =new Vector<Operation>();
			en =new Vector<Enum>();
			this.name="";
			this.me="";
		}
		
		public String getName(){
			return this.name;
		}
		
		
		public void setName(String nom){
			this.name = nom;
		}
		
		public String getMemberEnd(){
			return this.me;
		}
		
		
		public void setMemberEnd(String me){
			this.me = me;
		}
		
		public String getId(){
			return this.id;
		}
		
		
		public void setId(String id){
			this.id = id;
		}
		
		public String getType(){
			return this.type;
		}
		
		
		public void setType(String type){
			this.type = type;
		}
		
		public Vector<Attribute> getAtt(){
			return this.att;
		}
		
		public void setAtt(Vector<Attribute> att){
			this.att = att;
		}
		
		public Vector<Enum> getEnum(){
			return this.en;
		}
		
		public void setEnum(Vector<Enum> en){
			this.en = en;
		}
		
		
		public Vector<Operation> getOper(){
			return this.oper;
		}
		
		public void setOper(Vector<Operation> oper){
			this.oper = oper;
		}
		
		public void add(Attribute at){
			
			this.att.add(at);
		}
		
		public void add(Operation op){
			this.oper.add(op);
		}
		
		public void add(Enum en){
			this.en.add(en);
		}
		public String print(){
			String s;
			if(this.name.equals("")){
				 s = "MemberEnd : " + this.me +"\nId : " + this.id+" \nType : " + this.type+ " \nAttributes :  ";
			}else{
				 s = "Nom : " + this.name +"\nId : " + this.id+" \nType : " + this.type+ " \nAttributes :  ";
			}
			Attribute at;
			if (att==null){
				
			}else{
				for (int i=0; i<this.att.size(); i++){
					at = (Attribute) this.att.get(i);
					s = s + at.print()+ "  ";
				}
			}
			s = s+"\nOperation:  ";
			Operation op;
			if (oper==null){
				
			}else{
			
				for (int i=0; i<this.oper.size(); i++){
					op = (Operation) this.oper.get(i);
					s = s + op.print()+ "  ";
				}
			}
			
			if (en==null){
				
			}else{
				s = s+"\nEnumeration :  ";
				Enum en;
				for (int i=0; i<this.en.size(); i++){
					en = (Enum) this.en.get(i);
					s = s + en.print()+ "  ";
				}
			}
			s = s+"\n";
			return s;
		}
	
}
